<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>用户注册</title>
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script>
            $(document).ready(function(){
                
                $("#btn_add").click(function(){
                    $.ajax({
                        url:'aes',
                        type:'POST',
                        data: $("#add_form").serialize(),
                        success: function(data){
                            if(data==0){
                                alert("添加失败，请检查信息是否有误！");
                            }else{
                                alert("添加成功，请返回重新查询用户列表");
                            }
                        },
                        error: function(){
                            alert("error");
                        }
                    });
                });
            });
        </script>
    </head>
    <body>
        <div class="container text-warning">

            <h1 class="text-center bg-success text-success padding10">用户注册</h1>
            <hr>

            <form class="form-inline" id="add_form">
                <label for="iempid">用户编号：</label>
                <input id="iempid" type="text" name="empId" placeholder="填写一个用户账号" class="form-control sinfo">
                <br><br>
                <label for="iname">用户名：</label>
                <input id="iname" type="text" name="empName" placeholder="输入用户名，不超过4个中文字符" class="form-control sinfo">
                <br><br>
                <label for="igender">用户性别：</label>
                <select id="igender" name="empGender" class="form-control sinfo">
                    <option value="男">男</option>
                    <option value="女">女</option>
                </select>
                <br><br>
                <label for="idob">出生日期：</label>
                <input id="idob" name="empDob" type="text" class="form-control">
                <br><br>
                <button type="button" id="btn_add" class="btn btn-primary">确认注册</button>
            </form>
            <br>
        </div>

        
        

        <div class="text-center">
            <img src="images/love.jpg" alt="注册">
            <br><br>
            <a href="index.jsp" class="btn btn-sm btn-danger">返回首页</a>
        </div>

    </div>
</body>
</html>
